package com.bingbaihanji.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.bingbaihanji.pojo.Area;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

/**
 * @author 冰白寒祭
 * @date 2024-04-05 22:18:54
 * @description //TODO
 */
@Mapper
public interface AreaMapper extends BaseMapper<Area> {


    @Update("""
            DROP TABLE IF EXISTS `area`;            
            CREATE TABLE `area` (
            	`area_id` int NULL DEFAULT NULL,
            	`parent_id` int NULL DEFAULT NULL,
            	`name` varchar(120)
            )
            """)
    void createAreaTable();

    @Insert("""
             INSERT INTO `area` VALUES (1, 0, '北京');
             INSERT INTO `area` VALUES (2, 0, '天津');
             INSERT INTO `area` VALUES (3, 0, '河北省');
             INSERT INTO `area` VALUES (4, 0, '山西省');
             INSERT INTO `area` VALUES (5, 0, '内蒙古自治区');
             INSERT INTO `area` VALUES (6, 0, '辽宁省');
             INSERT INTO `area` VALUES (7, 0, '吉林省');
             INSERT INTO `area` VALUES (8, 0, '黑龙江省');
             INSERT INTO `area` VALUES (9, 0, '上海');
             INSERT INTO `area` VALUES (10, 0, '江苏省');
             INSERT INTO `area` VALUES (11, 0, '浙江省');
             INSERT INTO `area` VALUES (12, 0, '安徽省');
             INSERT INTO `area` VALUES (13, 0, '福建省');
             INSERT INTO `area` VALUES (14, 0, '江西省');
             INSERT INTO `area` VALUES (15, 0, '山东省');
             INSERT INTO `area` VALUES (16, 0, '河南省');
             INSERT INTO `area` VALUES (17, 0, '湖北省');
             INSERT INTO `area` VALUES (18, 0, '湖南省');
             INSERT INTO `area` VALUES (19, 0, '广东省');
             INSERT INTO `area` VALUES (20, 0, '广西壮族自治区');
             INSERT INTO `area` VALUES (21, 0, '海南省');
             INSERT INTO `area` VALUES (22, 0, '重庆');
             INSERT INTO `area` VALUES (23, 0, '四川省');
             INSERT INTO `area` VALUES (24, 0, '贵州省');
             INSERT INTO `area` VALUES (25, 0, '云南省');
             INSERT INTO `area` VALUES (26, 0, '西藏自治区');
             INSERT INTO `area` VALUES (27, 0, '陕西省');
             INSERT INTO `area` VALUES (28, 0, '甘肃省');
             INSERT INTO `area` VALUES (29, 0, '青海省');
             INSERT INTO `area` VALUES (30, 0, '宁夏回族自治区');
             INSERT INTO `area` VALUES (31, 0, '新疆维吾尔自治区');
             INSERT INTO `area` VALUES (32, 0, '台湾');
             INSERT INTO `area` VALUES (33, 0, '香港特别行政区');
             INSERT INTO `area` VALUES (34, 0, '澳门特别行政区');
             INSERT INTO `area` VALUES (35, 0, '海外');
             INSERT INTO `area` VALUES (36, 1, '北京市');
             INSERT INTO `area` VALUES (37, 2, '天津市');
             INSERT INTO `area` VALUES (38, 3, '石家庄市');
             INSERT INTO `area` VALUES (39, 3, '唐山市');
             INSERT INTO `area` VALUES (40, 3, '秦皇岛市');
             INSERT INTO `area` VALUES (41, 3, '邯郸市');
             INSERT INTO `area` VALUES (42, 3, '邢台市');
             INSERT INTO `area` VALUES (43, 3, '保定市');
             INSERT INTO `area` VALUES (44, 3, '张家口市');
             INSERT INTO `area` VALUES (45, 3, '承德市');
             INSERT INTO `area` VALUES (46, 3, '沧州市');
             INSERT INTO `area` VALUES (47, 3, '廊坊市');
             INSERT INTO `area` VALUES (48, 3, '衡水市');
             INSERT INTO `area` VALUES (49, 4, '太原市');
             INSERT INTO `area` VALUES (50, 4, '大同市');
             INSERT INTO `area` VALUES (51, 4, '阳泉市');
             INSERT INTO `area` VALUES (52, 4, '长治市');
             INSERT INTO `area` VALUES (53, 4, '晋城市');
             INSERT INTO `area` VALUES (54, 4, '朔州市');
             INSERT INTO `area` VALUES (55, 4, '晋中市');
             INSERT INTO `area` VALUES (56, 4, '运城市');
             INSERT INTO `area` VALUES (57, 4, '忻州市');
             INSERT INTO `area` VALUES (58, 4, '临汾市');
             INSERT INTO `area` VALUES (59, 4, '吕梁市');
             INSERT INTO `area` VALUES (60, 5, '呼和浩特市');
             INSERT INTO `area` VALUES (61, 5, '包头市');
             INSERT INTO `area` VALUES (62, 5, '乌海市');
             INSERT INTO `area` VALUES (63, 5, '赤峰市');
             INSERT INTO `area` VALUES (64, 5, '通辽市');
             INSERT INTO `area` VALUES (65, 5, '鄂尔多斯市');
             INSERT INTO `area` VALUES (66, 5, '呼伦贝尔市');
             INSERT INTO `area` VALUES (67, 5, '巴彦淖尔市');
             INSERT INTO `area` VALUES (68, 5, '乌兰察布市');
             INSERT INTO `area` VALUES (69, 5, '兴安盟');
             INSERT INTO `area` VALUES (70, 5, '锡林郭勒盟');
             INSERT INTO `area` VALUES (71, 5, '阿拉善盟');
             INSERT INTO `area` VALUES (72, 6, '沈阳市');
             INSERT INTO `area` VALUES (73, 6, '大连市');
             INSERT INTO `area` VALUES (74, 6, '鞍山市');
             INSERT INTO `area` VALUES (75, 6, '抚顺市');
             INSERT INTO `area` VALUES (76, 6, '本溪市');
             INSERT INTO `area` VALUES (77, 6, '丹东市');
             INSERT INTO `area` VALUES (78, 6, '锦州市');
             INSERT INTO `area` VALUES (79, 6, '营口市');
             INSERT INTO `area` VALUES (80, 6, '阜新市');
             INSERT INTO `area` VALUES (81, 6, '辽阳市');
             INSERT INTO `area` VALUES (82, 6, '盘锦市');
             INSERT INTO `area` VALUES (83, 6, '铁岭市');
             INSERT INTO `area` VALUES (84, 6, '朝阳市');
             INSERT INTO `area` VALUES (85, 6, '葫芦岛市');
             INSERT INTO `area` VALUES (86, 7, '长春市');
             INSERT INTO `area` VALUES (87, 7, '吉林市');
             INSERT INTO `area` VALUES (88, 7, '四平市');
             INSERT INTO `area` VALUES (89, 7, '辽源市');
             INSERT INTO `area` VALUES (90, 7, '通化市');
             INSERT INTO `area` VALUES (91, 7, '白山市');
             INSERT INTO `area` VALUES (92, 7, '松原市');
             INSERT INTO `area` VALUES (93, 7, '白城市');
             INSERT INTO `area` VALUES (94, 7, '延边朝鲜族自治州');
             INSERT INTO `area` VALUES (95, 8, '哈尔滨市');
             INSERT INTO `area` VALUES (96, 8, '齐齐哈尔市');
             INSERT INTO `area` VALUES (97, 8, '鸡西市');
             INSERT INTO `area` VALUES (98, 8, '鹤岗市');
             INSERT INTO `area` VALUES (99, 8, '双鸭山市');
             INSERT INTO `area` VALUES (100, 8, '大庆市');
            """)
    void insertAreaSql();

    @Update("drop table `area`")
    void deleteArea();
}
